import requests
import time

def get_data(code):
    license = "0FFB183E-423C-4150-A9BF-8273EE596138"
    (start_date, end_date) = get_time()
    # 分时级别：日线 除权方式：前复权
    url = "https://api.biyingapi.com/hsstock/history/{code}/d/f/{license}?st={start_date}&et={end_date}"


def get_time():
    localstime = time.localtime()
    tm_year = localstime.tm_year
    tm_mon = localstime.tm_mon
    
    start_date = "{}{}01".format(tm_year, tm_mon-1)
    end_date = time.strftime("%Y%m%d", localstime)
    return (start_date, end_date)

